// myList/pages/admin/admin.js

let name = "";
let password = "";

Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  //输入管理员账号
  inputName: function (event) {
    // console.log(event)
    name = event.detail
  },
  //输入管理员密码
  inputPassword(event) {
    // console.log(event)
    password = event.detail
  },

  //登陆
  login(){
    if(name=="admin"&&password=="123"){
      wx.showToast({
        title: '登陆成功',
        icon:"success"
      })
      .then(res =>{
        wx.navigateTo({
          url: '../../../shopInfo/pages/admin/admin',
        })
      }
      )
    }else{
      wx.showToast({
        title: '账号或密码错误',
        icon:"none"
      })
    }
  }
})